Using VisualStudio
My Other C++ Links | Move to VS |
back to top Move to VS
Renaming a OpenGL VS project by copying the lesson02.cpp to
OpenGLdraw.cpp and opening OpenGLdraw.cpp with Visual Studio 6.0
Got 22 link errors!
comparing Project Settings with those for lesson02, the critical
things I had to change to get OpenGLdraw project to build and run are:
- Link: Object/library modules: ADDED three libraries:
opengl32.lib glu32.lib gluax.lib
- This fixed most of the link errors, but I still got
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/OpenGLdraw.exe : fatal error LNK1120: 1 unresolved externals
- This fixed most of the link errors, but I still got
- Project Options: changed /subsystem:console to subsystem:windows
- that fixed the LIBCD.lib error! and the project built without errors and ran as expected!
Move ccurve.cpp and ccurve.h (from ~rossa at www.csm.astate.edu) to a Visual Studio 6.0 "Win32 Application" called ccurve, based on 'a typical "Hello World!" application'. (Replaced the generated ccurve.cpp with the downloaded version; also replaced ccurve.h in the Header Files folder.)
Initial compile error:
fatal error C1010: unexpected end of file while looking for precompiled header directive
Fix: Project Settings → C/C++ tab → Category:
Precompiled Headers,
change radio button selection from
"Use precompiled header file (.pch)" to "Not using precompiled headers"
After successful compile of ccurve project, I got Link errors:
error LNK2001: unresolved external symbol __beginthreadex
error LNK2001: unresolved external symbol __endthreadex
Fix: Project Settings → C/C++ tab → Category:
Code Generation, in choice box "Use run-time library:"
change pull down selection from "Debug Single-Threaded" to
"Debug Multitreaded" (or maybe to "Multithreaded" for production release...)
These steps solved the problem: the ccurve project now compiles and runs.